package cn.tedu.spring.life;

import java.util.concurrent.CopyOnWriteArrayList;

public class CategoryService {
    private CopyOnWriteArrayList<String> list;

    public void init() {
        list = new CopyOnWriteArrayList<>();
        list.add("家电");
        list.add("食品");
        list.add("服装");
        System.out.println(list);
    }

    public void destroy() {
        list.clear();
        System.out.println("list集合已销毁！");
    }
}
